1. Field of the Invention
The present invention relates to an information processing apparatus that detects a network device, an information processing method, and a storage medium.
2. Description of the Related Art
Typically, a conventional local area network (LAN) at home is constituted by Ethernet or a wireless LAN and uses Transmission Control Protocol/Internet Protocol (TCP/IP). The TCP/IP allows each device to be specified and to communicate with each other by using an IP address. However, since a user is required to have knowledge about a network when allocating an address, the user having no specific knowledge thereabout generally has difficulties.
Thus, at general homes, a router connecting the LAN to the Internet is provided with a server function of Dynamic Host Configuration Protocol (DHCP). Typically, this function automatically allocates an IP address to a connected device. Since the DHCP server dynamically allocates IP addresses, the same address is not always allocated to the connected device every time the connected device is activated.
When an electronic device such as a printing apparatus is used from a computer that is a host device, the computer stores an IP address of an electronic device and transmits data to the IP address thereof to communicate with the electronic device. At this point, when an address different from the IP address stored in the computer is allocated to the electronic device, the computer has no address for communicating with the electronic device, thereby being unable to communicate therewith.
In order to solve this problem, when the computer cannot communicate with the electronic device by using the IP address of the electronic device stored by the computer, a method is used for detecting a desired device by using broadcast or multicast via which a packet is transmitted to an unspecified target. This method enables the computer to store a variable value, which is the IP address of the device, and a value unique to the device such as a media access control (MAC) address, and to inquire about the IP address via broadcast.
A device which has received the inquiry transmits a response including a unique value (MAC address) therein. A device which has received the response compares a unique value stored in the device with the unique value included in the response to check whether the device which has responded is a desired device. Further, if an IP address is included in the response, the IP address of the desired device can be also checked.
There are examples in which a peripheral device such as a printer connected to a network is automatically recognized in an environment where a DHCP server dynamically allocates an IP address, as described below. Japanese Patent Application Laid-Open No. 2000-033755 discusses an example in which printer information is obtained via Service Location Protocol (SLP).
Japanese Patent Application Laid-Open No. 2002-007091 discusses an example in which a printer and a server connected to a network serve as a DHCP server. Japanese Patent Application Laid-Open No. 2004-048462 discusses an example in which variations of combinations of an IP address and a MAC address are recognized.
In recent years, according to increasing security consciousness, software of a firewall has been widely used for computers at home. The firewall monitors a communication of computers via a network and restricts the communication to prevent an unauthorized access from an external device and a connection to an unauthorized host.
Since data is transmitted to an unspecified host when the broadcast or the multicast is used, the computer can be restricted from using the broadcast and the multicast by some settings of the software of the firewall. In other words, for example, a response transmitted by an application to a request via the broadcast may not be able to reach the application due to a block by the firewall.
In this situation, the electronic device to which an address different from that allocated earlier by the DHC server cannot be detected via the broadcast or the multicast.
Since there are various kinds of software of the firewalls that are, for example, standard-equipped with an operation system and made by a third party, it is generally impossible for other applications to know settings of the software. Thus, even if the firewall is not set for a use via the broadcast or the multicast, the application cannot know the setting.
In other words, when the application cannot receive the response to the request transmitted via the broadcast or the multicast, the application cannot determine a reason of not receiving the response. More specifically, it is impossible to determine that the application cannot receive the response due to the block by the firewall or disconnection of the network, for example, a power of a target device is not turned on.
Since Linux (registered trademark) has more usages as a server than those of Windows (registered trademark) or Macintosh (registered trademark), a security level is set higher when the firewall is set. Further, Linux has countless varieties of distributions. Since major version is upgraded about every half a year, a user may not be able to set some types of the firewall, and the settings are different depending on the distribution, the firewall cannot be easily set.
In some environments, since the broadcast or the multicast may be blocked by some settings of the firewall, a device search may not be able to be performed via the broadcast. Thus, performing printing or acquiring a status is failed since the user may not be able to install or register a printer, or, since the device search is performed when printing or acquiring the status by using an installation unit and a registration unit that do not perform the search.
On the other hand, there is a method for inquiring about each address of the network. Using this method is advantageous in that the device can be always searched for without being bothered by the setting of the firewall. However, since all of the IP addresses allocated over the network need to be individually communicated, for example if 0.2 seconds are necessary for one device, and if 254 devices are allocated over the network, 0.2 seconds×254 devices=50.8 seconds are necessary at a maximum. For the broadcast, although necessary time differs depending on the setting, several seconds may be enough for making an inquiry.
Linux adopts the Common Unix (registered trademark) Printing System (CUPS) as a printing system. The printer can be registered on a printer registration function screen (http://localhost:631) of the CUPS (CUPS WEB user interface (U1) as illustrated in FIG. 1).
At this point, when a “new printer search” button 101 is clicked, each back-end (module communicating with the printer) installed in the system is activated. The back-end is used for searching for a printer. The back-ends include a standard back-end previously installed in the system of the Linux and the back-end to be copied to a system when a printer driver prepared by each vendor is installed.
The standard back-end includes a universal serial bus (USB), a parallel back-end, a Line Printer daemon protocol (LPR) back-end, and a back-end for a network. The buck-end to be copied includes the USB back-end for “A” company, the parallel backend for “A” company, an LPR back-end for “B” company, and a back-end for a network for “C” company. Further, a considerable number of back-ends unique to a type of each device are included.
Thus, since all of the back-ends are activated to search for a printer, even if only one back-end takes time to search for a printer, the CUPS WEB UI illustrated in FIG. 1 keeps searching. The back-end that takes time, for example, specifies each of all IP addresses in the network to search for a printer via unicast.
Since a screen does not change during a printer search, the user cannot perform a next operation. When the printer search is completed, a screen illustrated in FIG. 2A is displayed. When the user wants to add a printer, the user clicks an “add this printer” button 201. A screen where a name, a location, and description of the printer can be input is displayed as illustrated in FIG. 2B.
More specifically, examples are described below in which the printer search performed using the CUPS WEB UI takes time.
Condition (0) When a back-end for searching for each IP address among all addresses of the network is provided.
Example (1) When a USB printer is to be registered.
Example (2) When a power of a target printer in the network is off.
At this point, a time until the printer search is completed is, for example, if 0.2 seconds are necessary for one device, and if 254 devices are allocated to the network, 0.2 seconds×254 devices=50.8 seconds at a maximum.
In other words, when the broadcast or the multicast is used, even if a printer is not searched for due to the firewall, a printer can be registered. Thus, printing or acquisition of the status may not be eventually performed. On the other hand, if each of all IP addresses in the network is communicated via the unicast, too much time is necessary for the search.
Japanese Patent Application Laid-Open No. 2006-340286 discusses printer search processing by using the broadcast or multicast and the unicast together. However, since the CUPS WEB UI may be used for registration in the Linux environment, only one search method may fail in a search depending on timing for searching a printer, thereby causing inefficiency.